<template>
  <div id="app">
    <!-- 页面刷新:isRouterAlive -->
    <router-view v-if="isRouterAlive"></router-view>
  </div>
</template>

<script>
export default {
  name: 'app',
  data () {
    return {
      isRouterAlive: true
    }
  },
  provide () {                                          
    return {
      pageFresh: this.pageFresh                                            
    }
  },
  methods: {
    pageFresh () {
      // 通过视图的显示、消失，实现刷新效果
      this.isRouterAlive = false
      this.$nextTick(function () {
        this.isRouterAlive = true
      }) 
    }
  },
}
</script>

<style>
  .left{
    width:20%;
    border: 1px solid gray;
    float: left;
  }
</style>
